package com.tencent.stat.common;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;

class l
{
  static int a()
  {
    try
    {
      int i = new File("/sys/devices/system/cpu/").listFiles(new m()).length;
      return i;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
    return 1;
  }

  static int b()
  {
    int i;
    int j = 0;
    String str = "";
    try
    {
      InputStream localInputStream = new ProcessBuilder(new String[] { "/system/bin/cat", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq" }).start().getInputStream();
      byte[] arrayOfByte = new byte[24];
      while (localInputStream.read(arrayOfByte) != -1)
        str = str + new String(arrayOfByte);
      localInputStream.close();
      str = str.trim();
      i = j;
      if (str.length() > 0)
        i = Integer.valueOf(str).intValue();
      return (i * 1000);
    }
    catch (Exception localException)
    {
      StatCommonHelper.a().e(localException);
      i = j;
    }
  }

  static int c()
  {
    int i;
    int j = 0;
    String str = "";
    try
    {
      InputStream localInputStream = new ProcessBuilder(new String[] { "/system/bin/cat", "/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq" }).start().getInputStream();
      byte[] arrayOfByte = new byte[24];
      while (localInputStream.read(arrayOfByte) != -1)
        str = str + new String(arrayOfByte);
      localInputStream.close();
      str = str.trim();
      i = j;
      if (str.length() > 0)
        i = Integer.valueOf(str).intValue();
      return (i * 1000);
    }
    catch (Throwable localThrowable)
    {
      StatCommonHelper.a().e(localThrowable);
      i = j;
    }
  }

  static String d()
  {
    int i = 2;
    String[] arrayOfString = new String[2];
    arrayOfString[0] = "";
    arrayOfString[1] = "";
    try
    {
      BufferedReader localBufferedReader = new BufferedReader(new FileReader("/proc/cpuinfo"), 8192);
      Object localObject = localBufferedReader.readLine();
      if (localObject != null)
      {
        localObject = ((String)localObject).split("\\s+");
        while (i < localObject.length)
        {
          arrayOfString[0] = arrayOfString[0] + localObject[i] + " ";
          i += 1;
        }
      }
      localBufferedReader.close();
      return arrayOfString[0];
    }
    catch (IOException localIOException)
    {
    }
  }
}